Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

261
Views
Variable de JS a PHP usando AJAX - *Clave de matriz no definida "profile_viewer_uid" en C:\xampp\htdocs\zkoska\ppp.php en la línea 2*

Quería enviar la variable POST del archivo JS a PHP usando AJAX. Tengo estos dos archivos en la misma carpeta, pero cuando ejecuto el código php, no veo: Advertencia: clave de matriz no definida "profile_viewer_uid" en C:\xampp\htdocs\zkoska\ppp.php en la línea 2

¿Por qué no estaría definido profile_viewer_uid si lo tengo en JS y el código también contiene conexión: url: "PPP.php", ¿Qué está mal aquí?
Gracias

javas.js

 <script> var profile_viewer_uid = 1; $.ajax({ url: "PPP.php", method: "POST", data: { "profile_viewer_uid": profile_viewer_uid } }) </script>

ppp.php

 <?php $profile_viewer_uid = $_POST['profile_viewer_uid']; echo($profile_viewer_uid); // prints 1 ?>
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!